package cn.schina.dbfw.dao.impl;

public class SensiObjAnalysisResult {
	String owner;	//对象的属主,如果未知则返回[ANY]
	String object_name;		//对象名称(大写)
	int dbfw_inst_id;		//DBFW实例ID
	int sqlid;				//SQL唯一标识
	String db_server;		//DB服务器IP地址
	String dbuser;			//数据库用户名(大写)
	String db_client;		//客户端IP地址
	String sid;				//操作系统用户名
	String program_nm;		//应用或工具名称
	int session_count;		//相关会话数
	String sql_text;		//SQL语句
	int sqltype_1;			//SQL第一个关键词标识
	int sqltype_2;			//SQL第二个关键词标识
	int risk_borw;			//名单标记 0-名单外 1-白名单 2-黑名单
	int risk_tlevel;		//风险评估等级0～5 5—高风险 4—中高风险 3—中风险 2—中低风险 1—低风险 0—无风险
	int ac_tlevel;			//访问控制规则命中情况 0-未命中 1-命中
	int vpatch_tlevel;		//虚拟补丁规则命中情况 0-未命中 1-命中
	int alarm_flag_forall;	//告警情况 0-无告警 1-有告警
	int alarm_flag_rowlimits;	//是否有行数控制告警  0-无告警 1-有告警；如果发生行数控制告警，页面应显示"访问控制违规"
	String sqltype;				//SQL类型
	int help_alarm_flag;		//最终产生的是否告警的标记
	String help_tlevel;			//最终产生的风险级别文字
	String help_borw;			//黑白名单信息
	public String getOwner() {
		return owner;
	}
	public void setOwner(String owner) {
		this.owner = owner;
	}
	public String getObject_name() {
		return object_name;
	}
	public void setObject_name(String object_name) {
		this.object_name = object_name;
	}
	public int getDbfw_inst_id() {
		return dbfw_inst_id;
	}
	public void setDbfw_inst_id(int dbfw_inst_id) {
		this.dbfw_inst_id = dbfw_inst_id;
	}
	public int getSqlid() {
		return sqlid;
	}
	public void setSqlid(int sqlid) {
		this.sqlid = sqlid;
	}
	public String getDb_server() {
		return db_server;
	}
	public void setDb_server(String db_server) {
		this.db_server = db_server;
	}
	public String getDbuser() {
		return dbuser;
	}
	public void setDbuser(String dbuser) {
		this.dbuser = dbuser;
	}
	public String getDb_client() {
		return db_client;
	}
	public void setDb_client(String db_client) {
		this.db_client = db_client;
	}
	public String getSid() {
		return sid;
	}
	public void setSid(String sid) {
		this.sid = sid;
	}
	public String getProgram_nm() {
		return program_nm;
	}
	public void setProgram_nm(String program_nm) {
		this.program_nm = program_nm;
	}
	public int getSession_count() {
		return session_count;
	}
	public void setSession_count(int session_count) {
		this.session_count = session_count;
	}
	public String getSql_text() {
		return sql_text;
	}
	public void setSql_text(String sql_text) {
		this.sql_text = sql_text;
	}
	public int getSqltype_1() {
		return sqltype_1;
	}
	public void setSqltype_1(int sqltype_1) {
		this.sqltype_1 = sqltype_1;
	}
	public int getSqltype_2() {
		return sqltype_2;
	}
	public void setSqltype_2(int sqltype_2) {
		this.sqltype_2 = sqltype_2;
	}
	public int getRisk_borw() {
		return risk_borw;
	}
	public void setRisk_borw(int risk_borw) {
		this.risk_borw = risk_borw;
	}
	public int getRisk_tlevel() {
		return risk_tlevel;
	}
	public void setRisk_tlevel(int risk_tlevel) {
		this.risk_tlevel = risk_tlevel;
	}
	public int getAc_tlevel() {
		return ac_tlevel;
	}
	public void setAc_tlevel(int ac_tlevel) {
		this.ac_tlevel = ac_tlevel;
	}
	public int getVpatch_tlevel() {
		return vpatch_tlevel;
	}
	public void setVpatch_tlevel(int vpatch_tlevel) {
		this.vpatch_tlevel = vpatch_tlevel;
	}
	public int getAlarm_flag_forall() {
		return alarm_flag_forall;
	}
	public void setAlarm_flag_forall(int alarm_flag_forall) {
		this.alarm_flag_forall = alarm_flag_forall;
	}
	public int getAlarm_flag_rowlimits() {
		return alarm_flag_rowlimits;
	}
	public void setAlarm_flag_rowlimits(int alarm_flag_rowlimits) {
		this.alarm_flag_rowlimits = alarm_flag_rowlimits;
	}
	public String getSqltype() {
		return sqltype;
	}
	public void setSqltype(String sqltype) {
		this.sqltype = sqltype;
	}
	public int getHelp_alarm_flag() {
		this.help_alarm_flag = 0;
		if(this.alarm_flag_forall==1)
			this.help_alarm_flag = 1;
		if(this.alarm_flag_rowlimits==1)
			this.help_alarm_flag = 1;
		return help_alarm_flag;
	}
	public String getHelp_tlevel() {
		this.help_tlevel = "无风险";
		if(this.risk_tlevel>0)
		{
			switch (this.risk_tlevel) {
			case 5:			
				this.help_tlevel = "高风险";
				break;
			case 4:
			case 3:
				this.help_tlevel = "中风险";
				break;
			case 2:
			case 1:
				this.help_tlevel = "低风险";
				break;
			default:
				this.help_tlevel = "无风险";
				break;
			}
		}
		if(this.ac_tlevel==1)
		{
			this.help_tlevel = "访问控制违规";
		}
		if(this.vpatch_tlevel==2)
		{
			this.help_tlevel = "DB漏洞攻击";
		}
		return help_tlevel;
	}
	public String getHelp_borw() {
		switch (this.risk_borw) {
		case 0:
			this.help_borw = "名单外";
			break;
		case 1:
			this.help_borw = "白名单";
			break;
		case 2:
			this.help_borw = "黑名单";
			break;
		default:
			this.help_borw = "名单外";
			break;
		}
		return help_borw;
	}	
}
